var http=require('http');
var fs=require('fs');

function startServer(route,handle){
    //抽象一个方法
    var onRequest=function(request,response){
        console.log('request received....');
        route(handle,request.url,response);
    }
    
    var server=http.createServer(onRequest)

    server.listen(3000,'127.0.0.1');
    console.log('server started on localhost port 3000'); 
}

exports.startServer=startServer;
